package com.yycx.module.order.provider.service.impl;

import com.yycx.common.constants.CommonConstants;
import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.query.CriteriaQuery;
import com.yycx.module.order.client.entity.OrderCause;
import com.yycx.module.order.provider.mapper.OrderCauseMapper;
import com.yycx.module.order.provider.service.OrderCauseService;
import com.yycx.common.mybatis.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 退款方式 实现类
 *
 * @author flyme
 * @date 2019-11-28
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class OrderCauseServiceImpl extends BaseServiceImpl<OrderCauseMapper, OrderCause> implements OrderCauseService {

    @Override
    @Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
    public List<EntityMap> selectCaustList() {
        CriteriaQuery cq = new CriteriaQuery(OrderCause.class);
        cq.eq(OrderCause.class, "state", CommonConstants.ENABLED);
        return selectEntityMap(cq);
    }
}
